package net.wsfcp.android.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.zhy.adapter.recyclerview.CommonAdapter;
import com.zhy.adapter.recyclerview.base.ViewHolder;

import net.wsfcp.android.R;
import net.wsfcp.android.bean.resultbean.BillBean;
import net.wsfcp.android.bean.resultbean.DrawerBean;

import java.util.List;

//账单
public class BillAdapter extends CommonAdapter {


    public BillAdapter(Context context, int layoutId, List datas) {
        super(context, layoutId, datas);
    }

    @Override
    protected void convert(ViewHolder mHolder, Object o, int position) {

        BillBean.BillList bean = (BillBean.BillList) o;
        mHolder.setText(R.id.txt_remark, bean.getRemark());

        String txt = "";
        switch (bean.getOperationType()) {
            case 0:
                txt = "现金充值";
                break;
            case 1:
                txt = "购买商品";
                break;
            case 2:
                txt = "提取现金";
                break;

        }

        mHolder.setText(R.id.txt_type, txt);
        mHolder.setText(R.id.txt_time, bean.getShowCreateTime());
        mHolder.setText(R.id.txt_money, "￥" + bean.getShowPurseAmount());
        //        Glide.with(mContext).load( bean.getWapIconUri()).apply(new RequestOptions().placeholder(R.mipmap.ic_launcher)).into((ImageView) mHolder.getView(R.id.img_drawer_icon));

    }


}
